/*
* $Id: SyncChooseData.h 341 2011-10-20 17:56:56Z volok-aleksej@yandex.ru $
*
* Copyright 2009-2011 by Volokitin Aleksey
* All rights reserved
*
*/
#ifndef SYNC_CHOOSE_DATA_ID
#define SYNC_CHOOSE_DATA_ID

#include "WizardStep.h"
#include "Database/InterfaceDb.h"

class CSyncChooseData : public CWizardStep
{
	CFont *m_fontHeader;
	CFont *m_font;
	CWizardStep* m_pNext;
	IDatabase* m_database;
protected:
	CComboBox* m_comboPoints;
	CDateTimeCtrl* m_dateFrom;
	CDateTimeCtrl* m_dateTo;
	CListBox* m_freeFamily;
	CListBox* m_useFamily;
	CButton* m_right;
	CButton* m_left;
private:
	int m_curIdPoint;
	std::map<int, std::vector<int> > m_families;
	time_t m_beginTime;
	time_t m_endTime;
public:
	CSyncChooseData(CWizardStep* pBack, CWnd* pParentWnd);
	virtual ~CSyncChooseData();
protected:
	DECLARE_MESSAGE_HANDLER();
	bool OnPointChange(long param);
	bool OnRightButton(long param);
	bool OnLeftButton(long param);
public:
	virtual void Init(CPoint offset);
	virtual CWizardStep* Next();
	virtual CWizardStep* Back();
	virtual void Update();
private:
	void FillPoints();
	void FillFamilies();
	void SaveFamilies();
	void FillTimes();
	void SaveTimes();
};

#endif/*SYNC_CHOOSE_DATA_ID*/